<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%     
	String path = request.getContextPath();     
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";     
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>新增</title>
	<base href="<%=basePath%>"/>
	<link rel="stylesheet" type="text/css" href="css/common.css" />
	<link rel="stylesheet" href="<%=basePath%>/js/jquery-tablesorter/themes/blue/style.css" type="text/css" media="print, projection, screen" />
	<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="<%=basePath%>/js/jquery-tablesorter/jquery.tablesorter.min.js"></script>
    <script type="text/javascript" src="js/jquery.form.js"></script>
	<style type="text/css"> 
	  fieldset,legend,form,table,tr,td,textarea{margin:0;padding:0}
	  form label {font-weight:bold;}
	  table{margin:10px 10px};
	  td{line-height: 40px;}
	  input[type="text"]{width:250px;}
	  input[type="password"]{width:250px;}
	  input[type="textarea"]{width:250px;}
	</style>

<script type="text/javascript">
  $(document).ready(function(){
	  
      $("#scriptStr").focus();
  });
  
  function insert(){
	  var dependentEntity = $("#dependentEntity").val();
	  if(dependentEntity==null || dependentEntity==''){
		  alert("请选择依赖实例");
		  return;
	  }
	  $("#etlDepForm").submit();
  }

</script>
</head>
<body>
  <div>
    <fieldset>
      <legend>新增：</legend>
      <form id="etlDepForm" method="post" action="<%=basePath%>manage/etlDep?act=insert">
      	<input type="hidden" name="entityId" name="entityId" value="${entity.entityId }" />
      	<input type="hidden" name="entityName" name="entityName" value="${entity.entityName }" />
      	<c:if test="${error != null}"><p style="margin:10px 10px;"><font color="red">${error}</font></p></c:if>
        <table>
          <tr>
          	<td ><label for="name">实例名称：</label>
            	<input type="text" value="${entity.entityName }" disabled="disabled" />
            </td>
            <td ><label for="name">依赖实例名称：</label>
            	<select name="dependentEntity" id="dependentEntity" >
            		<option value="" >-请选择依赖实例-</option>
            		<c:forEach var="item" items="${entityList }" >
            			<option value="${item.entityId }-${item.entityName }" >${item.entitySchema }-${item.entityName }</option>
            		</c:forEach>
            	</select>
            </td>
            <td>
            	<input type="button" id="btn_insert" value="提交" onclick="insert()" style="width:80px;" />
            	<input type="button" id="btn_back" value="返回" onclick="history.back();" style="width:80px;" />
            </td>
          </tr>
        </table>
      </form>
    </fieldset>
  </div>
</body>
</html>